class SlideController {

	private static final long slideId = 1 // hard code this moment

	def scaffold = Frame.class
    
    // if there is id, do set
    def current = {    	
    	if (params.id) { // speaker mode
    		def f = Frame.get(slideId)
    		f.value = params.id
    		if(f.save()) {
    			render(text:'OK')
			} else {
				render(text:'XX')
			}
    	} else { // player mode
    		def currentFrame = Frame.get(1).value
    		render(text:"${currentFrame}")
    	}
    }
    
    def url = {
    	render(text: Frame.get(1).url)
    }
    
}
